package com.css.crm.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.css.crm.dao.PerformDao;
import com.css.crm.vo.PerformVo;

/**
 * Implementation for PerformDao
 * 
 * @author ais
 */
public class PerformDaoImpl extends BaseDaoImpl implements PerformDao {

	public PerformDaoImpl() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformDao#getPerformById(java.lang.String)
	 */
	@Override
	public PerformVo getPerformById(String id) {

		SqlSession session = getMyBatisSession();
		return session.selectOne("perform.getPerformById", id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformDao#deletePerformById(java.lang.String)
	 */
	@Override
	public int deletePerformById(String id) {

		SqlSession session = getMyBatisSession();
		return session.delete("perform.deletePerformById", id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformDao#insertPerform(com.css.crm.vo.PerformVo)
	 */
	@Override
	public int insertPerform(PerformVo vo) {

		SqlSession session = getMyBatisSession();
		return session.insert("perform.insertPerform", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformDao#updatePerform(com.css.crm.vo.PerformVo)
	 */
	@Override
	public int updatePerform(PerformVo vo) {

		SqlSession session = getMyBatisSession();
		return session.update("perform.updatePerform", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformDao#queryPerform(com.css.crm.vo.PerformVo)
	 */
	@Override
	public List<PerformVo> queryPerform(PerformVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectList("perform.queryPerform", vo);
	}

}
